import axios from 'axios';
/*
  切换角色
*/
// 获取角色列表
const path = window.serverUrl.routerPath || "http://localhost:8000";
export function fetchRole(params) {
  return axios({
    method: "GET",
    params,
    url: path + "/qxcd/roleSwitching/roleList"
  }).then(response => {
    return response.data;
  })
}

// 切换角色
export function switchRole(params) {
  return axios({
    method: "GET",
    params,
    url: path + "/qxcd/roleSwitching/upRoleIdNew"
  }).then(response => {
    return response.data;
  })
}

// 获取所有菜单
export function fetchAllMenus(params) {
  return axios({
    method: "GET",
    params,
    url: path + "/qxcd/caiDanGuanLi/getAllMenus"
  }).then(response => {
    return response.data;
  })
}